package com.ug.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ug.system.entity.TableInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 获取表信息
 * @author LY
 */
public interface ShowTablesMapper  extends BaseMapper<Object> {

    /**
     * 获取所有表
     */
    @Select("SHOW TABLES")
    List<String> getTables();

    /**
     * 获取表信息
     * @param tableName 表名
     */
    @Select("SHOW FULL COLUMNS FROM ${tableName}")
    List<TableInfo> getTableInfo(@Param("tableName") String tableName);
}
